namespace Mighty.Specs

import System
import System.IO
import System.Collections
import System.Collections.Generic
import System.Drawing
import System.Data
import Specter.Framework
import Mighty.Lib.Syntax
import Mighty.Lib.Controls

class XmlMocks:
	def constructor():
		pass
		
	def GetXmlSyntaxStream() as MemoryStream:
		contents as (string) = \
		(\
		"""<?xml version="1.0" encoding="utf-8" ?>""", \
		"<MightySyntax>",\
  		"<Language>", \
    	"C#",\
  		"</Language>",\
  		"<Declaratives>",\
    	"class,namespace,new,using,struct",\
  		"</Declaratives>",\
  		"<ConditionalsAndLoops>",\
    	"if,else,for,foreach,while,do,try,catch,finally",\
  		"</ConditionalsAndLoops>",\
		"<ValueTypes>",\
    	"int,decimal,double,char,string",\
  		"</ValueTypes>",\
  		"<ReferenceTypes>",\
    	"object",\
  		"</ReferenceTypes>",\
  		"<Void>",\
    	"void",\
  		"</Void>",\
  		"<Interfaces>",\
  		"</Interfaces>",\
  		"<ENums>",\
  		"</ENums>",\
		"</MightySyntax>",\
		)
		
		
		
		mStream as MemoryStream = MemoryStream()
		writer as StreamWriter = StreamWriter(mStream)
		for i in contents:
			writer.WriteLine(i)
		writer.Flush()
		mStream.Seek(0,SeekOrigin.Begin)
		
		return mStream
		
	def GetXmlColorSyntaxStream() as MemoryStream:
		raise Exception("not implemented")

context "CS Syntax Highlighting":
	syntaxStream as MemoryStream
	syntaxColorStream as MemoryStream
	box as MightyRichTextBox
	csSyntaxParser as CSSyntaxParser
	document as (string)
	
	setup:
		box = MightyRichTextBox()
		document = ("line 1", "line 2 foo", "bar line 3")
		box.Lines = document
		csSyntaxParser = CSSyntaxParser()
	
	specify "can parse a syntax xml document":
		raise Exception("not implemented")
	
	specify "can parse a syntax color scheme xml document":
		raise Exception("not implemented")
	
	specify "can insert a rtf color table in a newly loaded document":
		raise Exception("not implemented")
	
	specify "can fetch a line of rtf from a document with just a plaintext line number":
		raise Exception("not implemented")
		
	specify "given an unparsed rtf string and aprop regex, can insert coloring tags and return the modified string":
		raise Exception("not implemented")
	
	specify "can integrate a parsed string back into the document as a whole":
		raise NotImplementedException()
	
	specify "can process all lines of a MightyRichTextBox":
		raise Exception("not implemented")

